import requests


class Login:
    def __init__(self):
        self.url = "http://ihrm-test.itheima.net"

    def login(self, body):
        url = self.url + "/api/sys/login"
        return requests.post(url, json=body)
    def hq_token(self,body):
        resp = self.login(body)
        token = resp.json().get("data")
        return token
    def add_emp(self,body,header):
        url = self.url + "/api/sys/user"
        return requests.post(url,json=body,headers=header)
if __name__ == '__main__':
    a = Login()
    body = {
        "mobile": "13800000002",
        "password": "123456"}
    ss = a.hq_token(body)
    print(ss)